FROM openjdk:8u131-jdk-alpine
#openjdk:8u131-jdk-alpine
#openjdk:8-jdk-alpine
MAINTAINER WangDongping
# 切换用户
USER root
## 创建文件夹
RUN mkdir -p /opt/service/v2x-monitor
# 获取pom.xml中 dockerfile-maven-plugin 插件配置的参数
ARG JAR_FILE
ARG SERVER_PORT
ADD target/${JAR_FILE} /opt/service/v2x-monitor/${JAR_FILE}
RUN chmod -R 777 /opt/service/v2x-monitor
WORKDIR /opt/service/v2x-monitor
EXPOSE ${SERVER_PORT}
ENTRYPOINT java -XX:+StartAttachListener -Xmx2048M -Xms512M -jar v2x-monitor-server-1.0-SNAPSHOT.jar
#ENTRYPOINT java -XX:+StartAttachListener -Xmx512M -Xms512M -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError -jar v2x-monitor-server-1.0-SNAPSHOT.jar
#ENTRYPOINT ["java", "-XX:+StartAttachListener", "-Xmx512M", "-Xms512M", "-XX:+UseG1GC", "-XX:+PrintGCDetails", "-XX:+PrintGCTimeStamps", "-XX:+HeapDumpOnOutOfMemoryError", "-jar", "v2x-monitor-server-1.0-SNAPSHOT.jar"]
